package com.example.screenappreceive

import android.annotation.SuppressLint
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.SurfaceHolder
import android.view.SurfaceView

class MainActivity : AppCompatActivity() {
    @SuppressLint("MissingInflatedId")
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
       var  surfaceView = findViewById<SurfaceView>(R.id.surfaceView)
       surfaceView.holder.addCallback(object : SurfaceHolder.Callback{
           override fun surfaceCreated(holder: SurfaceHolder) {
                var socketLive = SocketLive(holder.surface)
                 socketLive.start()
           }

           override fun surfaceChanged(holder: SurfaceHolder, format: Int, width: Int, height: Int) {
           }

           override fun surfaceDestroyed(holder: SurfaceHolder) {
           }

       })
    }
}